<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_search
 * @copyright	Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
require_once(JPATH_BASE.DS.'components'.DS.'com_brinkmanvm'.DS.'helpers'.DS.'brinkmanvm.php');
?>


<div class="resultsSearchBKM">
<?php foreach($this->results as $result) : ?>
	<div class="resultItemSearch">
		<?php if($result->virtuemart_product_id):
			$caturl = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $result->virtuemart_category_id );
		?>
				<div class="result-image">
				<a href="<?php echo JRoute::_($result->href); ?>"<?php if ($result->browsernav == 1) :?> target="_blank"<?php endif;?>>
					<?php echo $image = BrinkmanvmHelper::showImage(strtolower($result->virtuemart_product_id),'img img-rounded imgResultsMain',true);	?>
				</a>
				</div>
		<?php endif;?>
		<div class="result-titleBkm">
			<?php echo $this->pagination->limitstart + $result->count.'. ';?>
			<?php if ($result->href) :?>
				<a href="<?php echo JRoute::_($result->href); ?>"<?php if ($result->browsernav == 1) :?> target="_blank"<?php endif;?>>
					<?php echo $this->escape($result->title);?>
				</a>
			<?php else:?>
				<?php echo $this->escape($result->title);?>
			<?php endif; ?>
			<?php if ($result->section) : ?>
				<div class="result-category">
					<span class="small<?php echo $this->pageclass_sfx; ?>">
					<?php if($result->virtuemart_product_id): ?>
						<a href="<?php echo $caturl;?>">
					<?php endif;?>
						(<?php echo $this->escape($result->section); ?>)
					<?php if($result->virtuemart_product_id): ?>
						</a>
					<?php endif;?>	
					
					</span>
				</div>
			<?php endif; ?>
			<div class="result-text">
				<?php echo $result->text; ?>
			</div>		
		</div>
	</div>

<?php endforeach; ?>
</div>

<div class="pagination">
	<?php echo $this->pagination->getPagesLinks(); ?>
</div>
